<template>
  <div class="app-container bg-white">
    <div class="dashboard-text">
      <div class="title">小雪梅的管理系统</div>
      <p class="welcome">欢迎进入</p>
      <div class="img">
        <img :src="imgIndex" alt="小雪梅的管理系统">
      </div>
    </div>
    <div class="dashboard-text">登录者: {{ name }}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Home',
  data() {
    return {
      imgIndex: require('@/assets/image/index.png')
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar'
    ])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    padding: 30px;
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
    text-align: center;
    padding-top: 60px;

    .title {
      font-size: 48px;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-fill-mode: forwards;
    }

    p.welcome {
      margin-top: 18px;
      margin: 20px auto;
      width: 140px;
      height: 36px;
      line-height: 36px;
      background: rgba(68, 148, 249, 1);
      border-radius: 18px;
      color: #fff;
      font-size: 18px;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.5s;
      animation-delay: 0.1s;
      animation-fill-mode: forwards;
    }

    .img {
      padding-top: 30px;
      opacity: 0;
      animation-name: slideUp;
      animation-duration: 0.8s;
      animation-fill-mode: forwards;

      img {
        width: 788px;
      }
    }

    @keyframes slideUp {
      0% {
        transform: translateY(60px);
        opacity: 0;
      }
      100% {
        transform: translateY(0);
        opacity: 1;
      }
    }
  }
}
</style>
